/*    */ package com.asiainfo.dacp.stat.olapcheck;
/*    */ 
/*    */ import java.util.Map;
/*    */ 
/*    */ public class DimItemData { private String ITEMNAME;
/*    */   private String ALERT_SCOPE;
/*    */   private String ALERTSTATE;
/*  8 */   private String REMARK; public String ITEMCODE; public String ISNEW = "normal";
/*    */   public double VAL;
/*    */   public double PVAL;
/*    */   
/* 12 */   public DimItemData(Map itemMap, String dimid) { this.ITEMCODE = (itemMap.get(dimid) != null ? itemMap.get(dimid).toString() : (String)itemMap.get(dimid));
/* 13 */     this.VAL = getDouble(itemMap.get("val"));
/* 14 */     this.PVAL = getDouble(itemMap.get("pval"));
/* 15 */     this.ADDVAL = MathUtil.subtract(Double.valueOf(this.VAL), Double.valueOf(this.PVAL)).doubleValue();
/* 16 */     if (this.PVAL == 0.0D) {
/* 17 */       this.DRATE = 9999.0D;
/*    */     }
/*    */     else {
/* 20 */       this.DRATE = MathUtil.divide(Double.valueOf(this.ADDVAL), Double.valueOf(this.PVAL)).doubleValue();
/*    */     }
/* 22 */     if ((this.PVAL == 0.0D) && (this.VAL != 0.0D)) {
/* 23 */       this.ISNEW = "add";
/*    */     }
/* 25 */     else if ((this.PVAL != 0.0D) && (this.VAL == 0.0D))
/* 26 */       this.ISNEW = "del";
/*    */   }
/*    */   
/*    */   public double DRATE;
/*    */   
/* 31 */   public void setFieldVal(String fieldName, Integer val) { if (fieldName == "ADDVAL_PARTINDEX") {
/* 32 */       this.ADDVAL_PARTINDEX = val.intValue();
/*    */     }
/* 34 */     else if (fieldName == "PVAL_INDEX") {
/* 35 */       this.PVAL_INDEX = val.intValue();
/*    */     }
/* 37 */     else if (fieldName == "VAL_INDEX") {
/* 38 */       this.VAL_INDEX = val.intValue();
/*    */     }
/* 40 */     else if (fieldName == "DRATE_INDEX") {
/* 41 */       this.DRATE_INDEX = val.intValue();
/*    */     }
/* 43 */     else if (fieldName == "VAL_INDEXCHG")
/* 44 */       this.VAL_INDEXCHG = val.intValue();
/*    */   }
/*    */   
/*    */   public double ADDVAL;
/*    */   public double ADDVAL_PARTRATE;
/*    */   
/* 50 */   public double getFieldVal(String fieldName) { if (fieldName == "DRATE") {
/* 51 */       return this.DRATE;
/*    */     }
/* 53 */     if (fieldName == "VAL") {
/* 54 */       return this.VAL;
/*    */     }
/* 56 */     if (fieldName == "PVAL") {
/* 57 */       return this.PVAL;
/*    */     }
/* 59 */     if (fieldName == "ADDVAL") {
/* 60 */       return this.ADDVAL;
/*    */     }
/* 62 */     if (fieldName == "ADDVAL_PARTRATE") {
/* 63 */       return this.ADDVAL_PARTRATE;
/*    */     }
/*    */     
/* 66 */     return -1.0D;
/*    */   }
/*    */   
/*    */   public double OP_SUMRATE;
/*    */   public int VAL_INDEX;
/*    */   public int PVAL_INDEX;
/*    */   
/* 73 */   protected static double getDouble(Object val) { try { if (val == null)
/* 74 */         return 0.0D;
/* 75 */       if ((val instanceof java.math.BigDecimal))
/* 76 */         return ((java.math.BigDecimal)val).doubleValue();
/* 77 */       if ((val instanceof Integer))
/* 78 */         return ((Integer)val).doubleValue();
/* 79 */       if ((val instanceof Float))
/* 80 */         return ((Float)val).doubleValue();
/* 81 */       if ((val instanceof String)) {
/* 82 */         String valStr = (String)val;
/* 83 */         if (valStr.indexOf(".") < 0)
/* 84 */           return Integer.parseInt(valStr);
/* 85 */         return Double.parseDouble(valStr); }
/* 86 */       if ((val instanceof Long)) {
/* 87 */         return Double.valueOf(val.toString()).doubleValue();
/*    */       }
/*    */       
/* 90 */       return ((Double)val).doubleValue();
/*    */ 
/*    */     }
/*    */     catch (Exception e)
/*    */     {
/* 95 */       e.printStackTrace(); }
/* 96 */     return -999.0D;
/*    */   }
/*    */   
/*    */   public int DRATE_INDEX;
/*    */   public int ADDVAL_PARTINDEX;
/*    */   public int VAL_INDEXCHG;
/*    */ }


/* Location:              C:\Users\my\.m2\repository\com\asiainfo\dacp\dacp-dataos\1.0.0\dacp-dataos-1.0.0.jar!\com\asiainfo\dacp\stat\olapcheck\DimItemData.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */